package site.jlopen.assets.config.interceptor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@Configuration
public class OssInterceptor implements HandlerInterceptor {
	private static Logger logger = LoggerFactory.getLogger(OssInterceptor.class);

	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {
		logger.info("{}", request);
		logger.info("{}", request.getRequestURI());
		logger.info("{}", request.getRequestURL());
		logger.info("{}", request);
		response.setCharacterEncoding("UTF-8");
		return true;
	}
	
	@Override
	public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
			ModelAndView modelAndView) throws Exception {
		
	}
}
